package com.hyt.it.ogt.ks.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyt.it.ogt.ks.api.kw.model.CandidateUseTimeDTO;
import com.hyt.it.ogt.ks.model.entity.CandidatePaper;
import com.hyt.it.ogt.ks.model.entity.CandidateTimeLength;
import com.hyt.it.ogt.ks.model.vo.AnswerTimeVO;
import com.hyt.it.ogt.ks.model.vo.CandidateSubjectPaperInfoVO;
import com.hyt.it.ogt.ks.model.xyvo.XyCandidateUseTimeVO;
import com.hyt.it.ogt.ks.model.xyvo.XyScoreVO;

/**
 * @author 刘恒活
 * @since 2021/5/24 14:56
 */
public interface CandidatePaperMapper extends BaseMapper<CandidatePaper>  {
    /**
     * 获取剩余时长
     * @param examId
     * @param candidateId
     * @param sort
     * @return
     */
    CandidateTimeLength getTimeLength(String examId, String candidateId, Integer sort);

    /**
     * 更新剩余时长、实际耗时等时间
     * @param examId
     * @param candidateId
     * @return
     */
    int updateTimeRef(String examId, String candidateId);

    /**
     * 更新性格测试卷大题为完成状态
     * @param candidateId
     * @param examId
     * @param sort
     * @param current
     */
    void updateFinishPage(String candidateId, String examId, Integer sort, Integer current);

    /**
     * 更新性格测试卷大题为完成状态
     * @param candidateId
     * @param examId
     * @param sort
     */
    void updateFinishAllPage(String candidateId, String examId, Integer sort);
    
    /**
     * 获取考生剩余时长
     * @param examId
     * @param candidateId
     * @return
     */
    List<CandidateUseTimeDTO> getCandidateUseTime(String examId, String candidateId);

    int updateExtraTimeByExamId(String examId, Long extraTime);

    CandidatePaper getCandidatePaper(String examId, String candidateId, String paperId, String paperVersion);

    int addTimeByBatch(String examId, String paperId, String paperVersion, Long timeLength);

    List<String> getAddedTimeCandidate(String examId, String paperId, String paperVersion);
    
    /**
     * 获取兴业银行成绩列表
     * @param candidateId
     * @return
     */
    XyScoreVO getXyScore(String candidateId);

    /**
     * 获取兴业银行成绩列表--当考生答题表备份时
     * @param candidateId
     * @return
     */
    XyScoreVO getXyScoreWhenBackup(String candidateId);
    
    /**
     * 获取兴业银行考试用时
     * @param candidateId
     * @return
     */
    XyCandidateUseTimeVO getXyCandidateUseTime(String candidateId);
    
    /**
     * 获取考试答题时长统计
     * @param examId
     * @return
     */
    AnswerTimeVO getExamAnswerTime(String examId);
    
    /**
     * 获取考生科目试卷信息
     * @param examId
     * @param admissionNumber
     * @return
     */
    List<CandidateSubjectPaperInfoVO> getCandidateSubjectPaperInfo(String examId, String admissionNumber);

    /**
     * 根据考生id获取考生科目试卷信息
     * @param examId
     * @param candidateIds
     * @return
     */
    List<CandidateSubjectPaperInfoVO> findCandidateSubjectPaperInfoList(String examId, List<String> candidateIds);


    List<CandidateUseTimeDTO> getCandidateUseTimeByCandidateIds(String examId, List<String> candidateIds);
}
